#ifndef IP_GIVER_H
#define IP_GIVER_H

#include "../../core/pch.h"

class IpGiver
{
	public:
		IpGiver(int ipgPort);

		/** Initialiaze ip giver. */
		STATUS InitNetwork();

		/** Start listening. */
		STATUS Listen();
	private:
		/** Ip giver address variable. */
		struct sockaddr_in ipgAddr;

		/** Client address variable. */
		struct sockaddr_in cliAddr;

		/** Ip giver socket. */
		int ipgSock;

		/** Ip giver port. */
		int ipgPort;

		/** Required for time settings. */
		struct timeval tv;

		/** Descriptor set. */
		fd_set readFds;

		/** Socket addr size. */
		socklen_t len;

		/** For return statuses. */
		STATUS ret;
};

#endif // !IP_GIVER_H
